﻿using Gmmy.Utility;
using Surging.Base;
using Surging.Core.EventBusRabbitMQ;
using Surging.Core.Log4net;
using Surging.Core.ServiceHosting;
using Surging.Core.ServiceHosting.Internal.Implementation;
using System;
using System.Linq;
using System.Text;
using Gmmy.DomainExtension;
using Surging.Core.Caching;
using Surging.Core.CPlatform;
using Surging.Core.CPlatform.Utilities;
using Surging.Core.ProxyGenerator;

namespace Host
{
    class Program
    {
        static void Main(string[] args)
        {
            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);//解决中文乱码问题
            var host = new ServiceHostBuilder()
                .RegisterMicroServices()//注册微服务实例到注册中心
                .Registerlog4Net("log4net.config")//注入日志
                .RegisterSwaggers()//注入动态swagger
                .UseServer(options => { }) //配置微服务实例
                .UseConsoleLifetime()//配置控制台常驻
                .RegConfigure(true, true)//配置事务+缓存设置
                .UseStartup<Startup>()
                .Build();

            using (host.Run())
            {
                Console.WriteLine($"用户服务启动成功，{DateTime.Now}。");
            }
        }
    }
}
